﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Marmat.Common.Http.JwtBearer
{
    /// <summary>
    /// JwtBearer 的结果过滤器，用于解析返回的 Authorization 值。
    /// </summary>
    public class JwtBearerResultFilterAttribute : ResultFilterAttribute
    {
        public override void OnResultExecuting(ApiActionContext context)
        {
            var authorization = context.Response.Headers["Authorization"];
            if (!string.IsNullOrEmpty(authorization))
                JwtBearerConfiguration.Authorization = authorization;
        }
    }
}
